package sk.scerbak.ucl.usecases.serializer;

import com.google.inject.Inject;
import com.google.inject.Provider;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider;
import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor;
import org.eclipse.xtext.serializer.sequencer.AbstractSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.GenericSequencer;
import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
import sk.scerbak.ucl.common.common.CommonPackage;
import sk.scerbak.ucl.common.common.Import;
import sk.scerbak.ucl.common.serializer.CommonSemanticSequencer;
import sk.scerbak.ucl.usecases.services.UsecasesGrammarAccess;
import sk.scerbak.ucl.usecases.usecases.ActionStep;
import sk.scerbak.ucl.usecases.usecases.Actor;
import sk.scerbak.ucl.usecases.usecases.AllStepsSelector;
import sk.scerbak.ucl.usecases.usecases.AnyAction;
import sk.scerbak.ucl.usecases.usecases.Condition;
import sk.scerbak.ucl.usecases.usecases.Extension;
import sk.scerbak.ucl.usecases.usecases.ExtensionStep;
import sk.scerbak.ucl.usecases.usecases.Goto;
import sk.scerbak.ucl.usecases.usecases.Interaction;
import sk.scerbak.ucl.usecases.usecases.Interest;
import sk.scerbak.ucl.usecases.usecases.Issue;
import sk.scerbak.ucl.usecases.usecases.Model;
import sk.scerbak.ucl.usecases.usecases.ScenarioEnd;
import sk.scerbak.ucl.usecases.usecases.Scope;
import sk.scerbak.ucl.usecases.usecases.SingleStepSelector;
import sk.scerbak.ucl.usecases.usecases.State;
import sk.scerbak.ucl.usecases.usecases.StepListSelector;
import sk.scerbak.ucl.usecases.usecases.StepRangeSelector;
import sk.scerbak.ucl.usecases.usecases.SubGoal;
import sk.scerbak.ucl.usecases.usecases.Trigger;
import sk.scerbak.ucl.usecases.usecases.UseCase;
import sk.scerbak.ucl.usecases.usecases.UsecasesPackage;
import sk.scerbak.ucl.usecases.usecases.Variant;

@SuppressWarnings("restriction")
public class AbstractUsecasesSemanticSequencer extends AbstractSemanticSequencer {

	@Inject
	protected UsecasesGrammarAccess grammarAccess;
	
	@Inject
	protected ISemanticSequencerDiagnosticProvider diagnosticProvider;
	
	@Inject
	protected ITransientValueService transientValues;
	
	@Inject
	@GenericSequencer
	protected Provider<ISemanticSequencer> genericSequencerProvider;
	
	protected ISemanticSequencer genericSequencer;
	
	@Inject
	protected Provider<CommonSemanticSequencer> superSequencerProvider;
	 
	protected CommonSemanticSequencer superSequencer; 
	
	@Override
	public void init(ISemanticSequencer sequencer, ISemanticSequenceAcceptor sequenceAcceptor, Acceptor errorAcceptor) {
		super.init(sequencer, sequenceAcceptor, errorAcceptor);
		this.genericSequencer = genericSequencerProvider.get();
		this.genericSequencer.init(sequencer, sequenceAcceptor, errorAcceptor);
		this.superSequencer = superSequencerProvider.get();
		this.superSequencer.init(sequencer, sequenceAcceptor, errorAcceptor); 
	}
	
	public void createSequence(EObject context, EObject semanticObject) {
		if(semanticObject.eClass().getEPackage() == CommonPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) {
			case CommonPackage.IMPORT:
				if(context == grammarAccess.getImportRule()) {
					sequence_Import(context, (Import) semanticObject); 
					return; 
				}
				else break;
			}
		else if(semanticObject.eClass().getEPackage() == UsecasesPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) {
			case UsecasesPackage.ACTION_STEP:
				if(context == grammarAccess.getActionStepRule()) {
					sequence_ActionStep(context, (ActionStep) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.ACTOR:
				if(context == grammarAccess.getActorRule()) {
					sequence_Actor(context, (Actor) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.ALL_STEPS_SELECTOR:
				if(context == grammarAccess.getAllStepsSelectorRule() ||
				   context == grammarAccess.getStepSelectorRule()) {
					sequence_AllStepsSelector(context, (AllStepsSelector) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.ANY_ACTION:
				if(context == grammarAccess.getActionRule() ||
				   context == grammarAccess.getAnyActionRule()) {
					sequence_AnyAction(context, (AnyAction) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.CONDITION:
				if(context == grammarAccess.getConditionRule()) {
					sequence_Condition(context, (Condition) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.EXTENSION:
				if(context == grammarAccess.getExtensionRule()) {
					sequence_Extension(context, (Extension) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.EXTENSION_STEP:
				if(context == grammarAccess.getExtensionEndStepRule()) {
					sequence_ExtensionEndStep(context, (ExtensionStep) semanticObject); 
					return; 
				}
				else if(context == grammarAccess.getExtensionStepRule()) {
					sequence_ExtensionStep(context, (ExtensionStep) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.GOTO:
				if(context == grammarAccess.getExtensionEndActionRule() ||
				   context == grammarAccess.getGotoRule()) {
					sequence_Goto(context, (Goto) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.INTERACTION:
				if(context == grammarAccess.getActionRule() ||
				   context == grammarAccess.getInteractionRule()) {
					sequence_Interaction(context, (Interaction) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.INTEREST:
				if(context == grammarAccess.getInterestRule()) {
					sequence_Interest(context, (Interest) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.ISSUE:
				if(context == grammarAccess.getIssueRule()) {
					sequence_Issue(context, (Issue) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.MODEL:
				if(context == grammarAccess.getModelRule()) {
					sequence_Model(context, (Model) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.PACKAGE:
				if(context == grammarAccess.getPackageRule()) {
					sequence_Package(context, (sk.scerbak.ucl.usecases.usecases.Package) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.SCENARIO_END:
				if(context == grammarAccess.getExtensionEndActionRule() ||
				   context == grammarAccess.getScenarioEndRule()) {
					sequence_ScenarioEnd(context, (ScenarioEnd) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.SCOPE:
				if(context == grammarAccess.getScopeRule()) {
					sequence_Scope(context, (Scope) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.SINGLE_STEP_SELECTOR:
				if(context == grammarAccess.getAbstractStepSelectorRule() ||
				   context == grammarAccess.getSingleStepSelectorRule()) {
					sequence_SingleStepSelector(context, (SingleStepSelector) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.STATE:
				if(context == grammarAccess.getStateRule()) {
					sequence_State(context, (State) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.STEP_LIST_SELECTOR:
				if(context == grammarAccess.getStepListSelectorRule() ||
				   context == grammarAccess.getStepSelectorRule()) {
					sequence_StepListSelector(context, (StepListSelector) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.STEP_RANGE_SELECTOR:
				if(context == grammarAccess.getAbstractStepSelectorRule() ||
				   context == grammarAccess.getStepRangeSelectorRule()) {
					sequence_StepRangeSelector(context, (StepRangeSelector) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.SUB_GOAL:
				if(context == grammarAccess.getActionRule() ||
				   context == grammarAccess.getSubGoalRule()) {
					sequence_SubGoal(context, (SubGoal) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.TRIGGER:
				if(context == grammarAccess.getTriggerRule()) {
					sequence_Trigger(context, (Trigger) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.USE_CASE:
				if(context == grammarAccess.getUseCaseRule()) {
					sequence_UseCase(context, (UseCase) semanticObject); 
					return; 
				}
				else break;
			case UsecasesPackage.VARIANT:
				if(context == grammarAccess.getVariantRule()) {
					sequence_Variant(context, (Variant) semanticObject); 
					return; 
				}
				else break;
			}
		if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
	}
	
	/**
	 * Constraint:
	 *     (name=ORD actor=[Actor|NAME] action=Action)
	 */
	protected void sequence_ActionStep(EObject context, ActionStep semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ACTION_STEP__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ACTION_STEP__NAME));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ACTION_STEP__ACTOR) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ACTION_STEP__ACTOR));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ACTION_STEP__ACTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ACTION_STEP__ACTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getActionStepAccess().getNameORDParserRuleCall_0_0(), semanticObject.getName());
		feeder.accept(grammarAccess.getActionStepAccess().getActorActorNAMEParserRuleCall_2_0_1(), semanticObject.getActor());
		feeder.accept(grammarAccess.getActionStepAccess().getActionActionParserRuleCall_4_0(), semanticObject.getAction());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (name=NAME description=PlainText?)
	 */
	protected void sequence_Actor(EObject context, Actor semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     anywhere?='*'
	 */
	protected void sequence_AllStepsSelector(EObject context, AllStepsSelector semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ALL_STEPS_SELECTOR__ANYWHERE) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ALL_STEPS_SELECTOR__ANYWHERE));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getAllStepsSelectorAccess().getAnywhereAsteriskKeyword_0(), semanticObject.isAnywhere());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     description=PlainText
	 */
	protected void sequence_AnyAction(EObject context, AnyAction semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ANY_ACTION__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ANY_ACTION__DESCRIPTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getAnyActionAccess().getDescriptionPlainTextParserRuleCall_0(), semanticObject.getDescription());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (actor=[Actor|NAME] description=State)
	 */
	protected void sequence_Condition(EObject context, Condition semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.CONDITION__ACTOR) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.CONDITION__ACTOR));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.CONDITION__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.CONDITION__DESCRIPTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getConditionAccess().getActorActorNAMEParserRuleCall_0_0_1(), semanticObject.getActor());
		feeder.accept(grammarAccess.getConditionAccess().getDescriptionStateParserRuleCall_2_0(), semanticObject.getDescription());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     action=ExtensionEndAction
	 */
	protected void sequence_ExtensionEndStep(EObject context, ExtensionStep semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (actor=[Actor|NAME] action=Action)
	 */
	protected void sequence_ExtensionStep(EObject context, ExtensionStep semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.EXTENSION_STEP__ACTOR) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.EXTENSION_STEP__ACTOR));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.EXTENSION_STEP__ACTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.EXTENSION_STEP__ACTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getExtensionStepAccess().getActorActorNAMEParserRuleCall_0_0_1(), semanticObject.getActor());
		feeder.accept(grammarAccess.getExtensionStepAccess().getActionActionParserRuleCall_2_0(), semanticObject.getAction());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (occurance=StepSelector condition=Condition steps+=ExtensionStep* steps+=ExtensionEndStep)
	 */
	protected void sequence_Extension(EObject context, Extension semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     nextStep=[ActionStep|ORD]
	 */
	protected void sequence_Goto(EObject context, Goto semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.GOTO__NEXT_STEP) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.GOTO__NEXT_STEP));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getGotoAccess().getNextStepActionStepORDParserRuleCall_1_0_1(), semanticObject.getNextStep());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     importedNamespace=QualifiedNameWithWildcard
	 */
	protected void sequence_Import(EObject context, Import semanticObject) {
		superSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (description=PlainText subject=[Data|NAME])
	 */
	protected void sequence_Interaction(EObject context, Interaction semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.INTERACTION__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.INTERACTION__DESCRIPTION));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.INTERACTION__SUBJECT) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.INTERACTION__SUBJECT));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getInteractionAccess().getDescriptionPlainTextParserRuleCall_0_0(), semanticObject.getDescription());
		feeder.accept(grammarAccess.getInteractionAccess().getSubjectDataNAMEParserRuleCall_1_0_1(), semanticObject.getSubject());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (stakeholder=[Actor|NAME] description=PlainText)
	 */
	protected void sequence_Interest(EObject context, Interest semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.INTEREST__STAKEHOLDER) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.INTEREST__STAKEHOLDER));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.INTEREST__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.INTEREST__DESCRIPTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getInterestAccess().getStakeholderActorNAMEParserRuleCall_0_0_1(), semanticObject.getStakeholder());
		feeder.accept(grammarAccess.getInterestAccess().getDescriptionPlainTextParserRuleCall_2_0(), semanticObject.getDescription());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (actor=[Actor|NAME] description=PlainText)
	 */
	protected void sequence_Issue(EObject context, Issue semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ISSUE__ACTOR) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ISSUE__ACTOR));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.ISSUE__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.ISSUE__DESCRIPTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getIssueAccess().getActorActorNAMEParserRuleCall_0_0_1(), semanticObject.getActor());
		feeder.accept(grammarAccess.getIssueAccess().getDescriptionPlainTextParserRuleCall_2_0(), semanticObject.getDescription());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (imports+=Import* package=Package)
	 */
	protected void sequence_Model(EObject context, Model semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (name=QualifiedName usecases+=UseCase+)
	 */
	protected void sequence_Package(EObject context, sk.scerbak.ucl.usecases.usecases.Package semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     result=ScenarioResult
	 */
	protected void sequence_ScenarioEnd(EObject context, ScenarioEnd semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.SCENARIO_END__RESULT) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.SCENARIO_END__RESULT));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getScenarioEndAccess().getResultScenarioResultEnumRuleCall_1_0(), semanticObject.getResult());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (visibility=Visibility? type=ScopeType? internalActor=Actor)
	 */
	protected void sequence_Scope(EObject context, Scope semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     step=[ActionStep|ORD]
	 */
	protected void sequence_SingleStepSelector(EObject context, SingleStepSelector semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.SINGLE_STEP_SELECTOR__STEP) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.SINGLE_STEP_SELECTOR__STEP));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getSingleStepSelectorAccess().getStepActionStepORDParserRuleCall_0_1(), semanticObject.getStep());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     name=PlainText
	 */
	protected void sequence_State(EObject context, State semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.STATE__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.STATE__NAME));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getStateAccess().getNamePlainTextParserRuleCall_0(), semanticObject.getName());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (selectors+=AbstractStepSelector selectors+=AbstractStepSelector*)
	 */
	protected void sequence_StepListSelector(EObject context, StepListSelector semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (from=[ActionStep|ORD] to=[ActionStep|ORD])
	 */
	protected void sequence_StepRangeSelector(EObject context, StepRangeSelector semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.STEP_RANGE_SELECTOR__FROM) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.STEP_RANGE_SELECTOR__FROM));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.STEP_RANGE_SELECTOR__TO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.STEP_RANGE_SELECTOR__TO));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getStepRangeSelectorAccess().getFromActionStepORDParserRuleCall_0_0_1(), semanticObject.getFrom());
		feeder.accept(grammarAccess.getStepRangeSelectorAccess().getToActionStepORDParserRuleCall_2_0_1(), semanticObject.getTo());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     includeUseCase=[UseCase|NAME]
	 */
	protected void sequence_SubGoal(EObject context, SubGoal semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.SUB_GOAL__INCLUDE_USE_CASE) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.SUB_GOAL__INCLUDE_USE_CASE));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getSubGoalAccess().getIncludeUseCaseUseCaseNAMEParserRuleCall_0_1(), semanticObject.getIncludeUseCase());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (actor=[Actor|NAME] action=Action)
	 */
	protected void sequence_Trigger(EObject context, Trigger semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.TRIGGER__ACTOR) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.TRIGGER__ACTOR));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.TRIGGER__ACTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.TRIGGER__ACTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getTriggerAccess().getActorActorNAMEParserRuleCall_0_0_1(), semanticObject.getActor());
		feeder.accept(grammarAccess.getTriggerAccess().getActionActionParserRuleCall_2_0(), semanticObject.getAction());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (
	 *         name=NAME 
	 *         description=PlainText? 
	 *         scope=Scope? 
	 *         level=Level? 
	 *         primaryActor=Actor 
	 *         secondaryActors+=Actor* 
	 *         tertiaryActors+=Actor* 
	 *         interests+=Interest* 
	 *         preconditions+=Condition* 
	 *         postconditions+=Condition* 
	 *         invariants+=Condition* 
	 *         trigger=Trigger? 
	 *         steps+=ActionStep+ 
	 *         extensions+=Extension* 
	 *         variants+=Variant* 
	 *         issues+=Issue*
	 *     )
	 */
	protected void sequence_UseCase(EObject context, UseCase semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (occurance=StepSelector description=PlainText)
	 */
	protected void sequence_Variant(EObject context, Variant semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.VARIANT__OCCURANCE) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.VARIANT__OCCURANCE));
			if(transientValues.isValueTransient(semanticObject, UsecasesPackage.Literals.VARIANT__DESCRIPTION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, UsecasesPackage.Literals.VARIANT__DESCRIPTION));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getVariantAccess().getOccuranceStepSelectorParserRuleCall_0_0(), semanticObject.getOccurance());
		feeder.accept(grammarAccess.getVariantAccess().getDescriptionPlainTextParserRuleCall_1_0(), semanticObject.getDescription());
		feeder.finish();
	}
}
